package com.fkdx.dao.condition;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;

@Data
public class TableCondition {

    @ApiModelProperty(value = "'查询偏移量' 不能小于0")
    @Min(value = 1, message = "'查询偏移量' 不能小于0")
    private Integer offset = 1;

    @ApiModelProperty(value = "'每页显示条数' 不能大于100")
    @Max(value = 100, message = "'每页显示条数' 不能大于100")
    private Integer limit = 10;

    @ApiModelProperty(value = "'排序方式' 只能是asc或desc")
    @Pattern(regexp = "asc|desc", message = "'排序方式' 只能是asc或desc")
    private String order;

    @ApiModelProperty(value = "排序字段")
    @Pattern(regexp = "", message = "'排序字段' 字段名有误")
    private String sort;

    private boolean initiate = true;

    private Long tenantId;
}
